/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    TabBarIOS,
    StatusBar
} from 'react-native';

// 隐藏状态栏
StatusBar.setHidden(true);

var BookList = require("./src/book/book_list");
var Navigation = require("./src/common/navigation");

// Tabbar的两个模块
export default class douban_rn extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selectedTab: "图书"
    };
  }
  render() {
    return (
        <TabBarIOS>
          <TabBarIOS.Item
            icon={require('./src/img/图书.png')}
            title="图书"
            selected={this.state.selectedTab==="图书"}
            onPress={() => {
              this.setState({
                selectedTab:"图书"
              })
            }}>
            {/*<View style={{backgroundColor:"cyan", flex:1}}></View>*/}
            {/*<Navigation component={BookList}/>*/}
            <BookList/>
          </TabBarIOS.Item>
          <TabBarIOS.Item
              icon={require('./src/img/电影.png')}
              title="电影"
              selected={this.state.selectedTab==="电影"}
              onPress={() => {
                this.setState({
                  selectedTab:"电影"
                })
              }}>
            <View style={{backgroundColor:"yellow", flex:1}}></View>
          </TabBarIOS.Item>
        </TabBarIOS>

    );
  }
}

AppRegistry.registerComponent('douban_rn', () => douban_rn);
